{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Resourcing: Solar panel cells" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem Definition\n", "\n", "Weyland Corp is a British firm that manufactures solar panel cells. This firm supplies three different types of cell called: fast, normal and ultra. There are three operations involved in the manufacturing process. The following table describes the hours/month required to manufacture each model: \n", "\n", "**Table 1:** hours/month requirements\n", "\n", "| Operation | Fast (hours/cell) | Normal (hours/cell) | Ultra (hours/cell) | \n", "|-----------|-------------------|---------------------|--------------------|\n", "| 1 | 1 | 3 | 2 |\n", "| 2 | 2 | 0 | 3 |\n", "| 3 | 1 | 4 | 0 |\n", "\n", "And the following table describes the total hours available for each operation:\n", "\n", "**Table 2:** Total hours/month available\n", "\n", "| Operation | Hours/Month |\n", "|-----------|-------------|\n", "| 1 | 400 |\n", "| 2 | 600 |\n", "| 3 | 600 |\n", "\n", "The profit per each model is specified in the following table:\n", "**Table 3:** Unit of profit per model\n", "\n", "| Model | Profit/Unit |\n", "|--------|-------------|\n", "| Fast | 30 |\n", "| Normal | 20 |\n", "| Ultra | 40 |" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem Model\n", "### Decision variables\n", "The decision variables are: \n", "\n", "$x_1:$Units of Fast cells / month\n", "\n", "$x_2:$Units of Normal cells / month\n", "\n", "$x_3:$Units of Ultra cells / month\n", "\n", "### Objective Function\n", "The objective function is:\n", "\n", "$\\max z=30x_1+20x_2+40x_3$\n", "\n", "### Constraints\n", "Subject to the following constraints:\n", "\n", "$x_1+3x_2+2x_3 \\leq 400$\n", "\n", "$2x_1+0x_2+3x_3 \\leq 600$\n", "\n", "$x_1+4x_2+0x_3 \\leq 600$\n", "\n", "### Solution\n", "The following solution has been obtained using PuLP and the Gurobi solver. \n", "\n", "\n", "Total profit is 9666.67 €\n", "\n", "The following table shows the values of the decision variables, the reduced costs and the sensitivity analysis of the objective coefficients: \n", " \n", "| | Variables | Solution | Reduced cost | Objective Coefficient | Objective Lower bound | Objective Upper bound |\n", "|:-------|:-------------|-----------------:|---------------------:|------------------------------:|------------------------------:|------------------------------:|\n", "| fast | cells_fast | 300 | 0 | 30 | 24.44 | inf |\n", "| normal | cells_normal | 33.33 | 0 | 20 | -0 | 90 |\n", "| ultra | cells_ultra | 0 | -8.33 | 40 | -inf | 48.33 |\n", "\n", "The following table shows the slack and shadow prices of the constraints, together with a sensitivity analysis of the RHS: \n", "\n", "| | Constraint | Right Hand Side | Shadow Price | Slack | Min RHS | Max RHS |\n", "|---:|:-------------|------------------:|---------------:|--------:|----------:|----------:|\n", "| 0 | Operation_1 | 400 | 6.67 | 0 | 300 | 525 |\n", "| 1 | Operation_2 | 600 | 11.67 | 0 | 0 | 800 |\n", "| 2 | Operation_3 | 600 | 0 | 166.67 | 433.33 | inf |\n", "\n", "### Question 1\n", "\n", "Peter Weyland believes that, for the reputation of the company, Weyland should manufacture at least 40 ultra cells per month. If this plan goes ahead, how would it affect the current profit?\n", "\n", "In the current optimal solution, ultra cells are not part of the solution and therefore using resources to manufacture this type of cells will decrease the profits. The reduced costs for ultra cells are -8.33, meaning that the profits are going to decrease 8.33 for every extra cell that is manufactured.\n", "Therefore, 40 extra units of ultra would lower the profits: **333.33**\n", "\n", "\n", "### Question 2\n", "The engineer informed management that due to maintenance operations, the capacities of Operation 1, 2, and 3 have changed to 360, 600 and 500 respectively. How would this affect the profit?\n", "\n", "We need to analyse the cases one by one. Regarding operation 1, the slack is 0 and the shadow price is 6.67, meaning that having 1 unit less will lower the profits 6.67€. The minimum RHS is 300, which is lower than 360 and therefore there is no change in the basic solution. \n", "With this, A decrease of 40 units will cause a decrease in the budget of 266.67€. \n", "\n", "There is no impact on the capacity of Operation 2, the RHS is still 600.\n", "\n", "Operation 3 has a slack of 166.67, which is higher than the 100 decrease due to maintenance operations, so there will be no impact on the profits. \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Question 3\n", "Mr. Weyland insisted that the company needs to change the strategy towards producing ultra fast cells to position Weyland Corp in this segment. The company reviewed the prices of the ultra fast cells and changed them to 30€, 10€ and 50€ per fast, normal and ultra cells. With the new prices, would it be profitable to produce ultra fast cells?" ] }, { "cell_type": "markdown", "metadata": { "scrolled": true, "pycharm": { "name": "#%% md\n" } }, "source": [ "We need to verify the bounds for the objective coefficients for the three variables, case by case. \n", "\n", "For fast cells, there is no change in the price. \n", "\n", "For normal cells, the new price of 10€ is higher than the lower bound of the solution, therefore, there will be no change caused by these decrease. \n", "\n", "For ultra cells, the new price is over the maximum lower price, so this change will cause a change in the basic solution:\n", "\n", "\n", "| | Variables | Solution | Reduced cost | Objective Coefficient | Objective Lower bound | Objective Upper bound |\n", "|:------|:------------|-----------------:|---------------------:|------------------------------:|------------------------------:|------------------------------:|\n", "| ultra | cells_ultra | 0 | -8.33 | 40 | -inf | **48.33** |\n", "\n", "Using the tableau we can verify that the entering variable is the ultra cell and conclude that it is profitable to produce ultra fast cells with the new prices.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Question 4\n", "What is the impact in the new profit if we opted for this new prices?" ] }, { "cell_type": "markdown", "metadata": { "scrolled": true, "pycharm": { "name": "#%% md\n" } }, "source": [ "We need to define the new problem and solve it. Using PuLP and CBC, the solution obtained is: \n", "- Total profit is **10000.00** € per month\n", "\n", "Therefore, the profit would change in **333.33** € per month\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Question 5\n", "The engineer is studying a new type of fast cells that would require 2 hours of operation 1, 0 hours of operation 2 and 1 hour of operation 3. The estimated market price is 20€. How would this affect the production plan?" ] }, { "cell_type": "markdown", "metadata": { "scrolled": true, "pycharm": { "name": "#%% md\n" } }, "source": [ "We need to define a new problem model to introduce the new standard cell type and solve it. The following solution has \n", "been obtained with PuLP and Gurobi.\n", "\n", "The total profit is **10000.00** € per month\n", "\n", "The following tables show the values obtained: \n", "\n", "| | Decision Variable | Solution value | Unit profit | Reduced cost | Lower bound | Upper bound |\n", "|---:|:--------------------|-----------------:|--------------:|---------------:|--------------:|--------------:|\n", "| 0 | cells_fast | 300 | 30 | 0 | 23.3333 | inf |\n", "| 1 | cells_normal | 0 | 20 | -10 | -inf | 30 |\n", "| 2 | cells_standard | 50 | 20 | 0 | 13.3333 | 60 |\n", "| 3 | cells_ultra | 0 | 40 | -10 | -inf | 50 |\n", "\n", "The following table shows the problem constraints: \n", "\n", "| | Constraint | Left-hand side | Sense | Right-hand side | Slack | Shadow price | Lower bound | Upper bound |\n", "|---:|:-------------|-----------------:|------------:|------------------:|--------:|---------------:|--------------:|--------------:|\n", "| 0 | Operation_1 | 400 | <= | 400 | 0 | 10 | 300 | 600 |\n", "| 1 | Operation_2 | 600 | <= | 600 | 0 | 10 | 0 | 800 |\n", "| 2 | Operation_3 | 400 | <= | 600 | 200 | 0 | 400 | inf |\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Question 6\n", "Mr. Weyland thinks that the operation time for Operation 2 for the normal cells can be cut to only 3 hours per cell. How would this improve the production plan?" ] }, { "cell_type": "markdown", "metadata": { "scrolled": true, "pycharm": { "name": "#%% md\n" } }, "source": [ "This will mean a change in a LHS coefficient of a constraint, we would need to build a new model with this new coefficient and solve it again with a solver.\n", "\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" }, "pycharm": { "stem_cell": { "cell_type": "raw", "source": [], "metadata": { "collapsed": false } } } }, "nbformat": 4, "nbformat_minor": 1 }